﻿using System;
using TicketReservationSystem.Application.Properties;
using TicketReservationSystem.DataAccess;
using TicketReservationSystem.FlightManagement;
using TicketReservationSystem.FlightSearch;
using TicketReservationSystem.Presentation;
using TicketReservationSystem.TicketReservation;
using TicketReservationSystem.WinView;

namespace TicketReservationSystem.Application
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            var view = MainViewFactory.Build();
            var data = DataAccessFactory.Build(Resources.ConnectionString);
            var search = FlightSearchFactory.Build(data);
            var management = FlightManagementFactory.Build(data);
            var reservation = TicketReservationFactory.Build(data);

            new Presenter(view, search, management, reservation, data);

            System.Windows.Forms.Application.Run(view as System.Windows.Forms.Form);
        }
    }
}
